package com.ruoyi.project.business.schedulerule.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.model.AjaxResult;
import com.ruoyi.project.business.domain.utils.RuleUtil;
import com.ruoyi.project.business.schedulerule.request.ListMonthScheduleRuleRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 排班规则 的字典接口， 告诉前端有哪些规则可以配置
 * 
 * @author ${author}
 * @date 2024-03-06
 */
@RestController
@RequestMapping("/business/ruledicts")
public class RuleDictController extends BaseController {

    /**
     * 用户规则
     * @param request
     * @return
     */
    @GetMapping("/month")
    public AjaxResult listMonth(ListMonthScheduleRuleRequest request) {
        return AjaxResult.success(RuleUtil.findMonthRuleSimpleClassNames());
    }

    /**
     * 管理类规则
     * @param request
     * @return
     */
    @GetMapping("/month-of-manager")
    public AjaxResult listMonthOfManager(ListMonthScheduleRuleRequest request) {
        return AjaxResult.success(RuleUtil.findMonthRuleSimpleClassNamesOfManager());
    }

    @GetMapping("/daily")
    public AjaxResult listDaily(ListMonthScheduleRuleRequest request) {
        return AjaxResult.success(RuleUtil.findDailyRuleSimpleClassNames());
    }

    @GetMapping("/daily-of-manager")
    public AjaxResult listDailyOfManager(ListMonthScheduleRuleRequest request) {
        return AjaxResult.success(RuleUtil.findDailyRuleSimpleClassNamesOfManager());
    }

}
